Reflect broken symlinks in resources model - #2798
Conversation
6f6c255 to
06b408f
Compare
Requires fix in platform, see eclipse-platform/eclipse.platform#2798 See eclipse-platform/eclipse.platform#2797
06b408f to
de6092f
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Eclipse Core Resources / EFS stack so broken (dangling) symbolic links are surfaced in the workspace resource model (enabling UI overlays and user visibility/removal), including Linux-native support and accompanying regression tests.
Changes:
- Treat dangling symlinks as “present” resources in workspace tree logic and attribute lookup (so they appear in members/refresh and can be deleted).
- Preserve symlink metadata (lstat) for dangling links in Linux native implementations, and expose link target/attributes via EFS.
- Add/extend tests to validate dangling symlink visibility and “read as empty content” behavior.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java | Adds a workspace-level regression test ensuring broken symlinks appear as child IFile resources and behave safely for read APIs. |
| resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/SymlinkTest.java | Extends filesystem-level tests for broken symlink timestamps/lengths and recursive symlink existence expectations. |
| resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/ResourceTree.java | Ensures deletes don’t treat broken symlinks as “nonexistent on disk”. |
| resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/UnifiedTreeNode.java | Treats symlink nodes as existing in filesystem even when targets are missing. |
| resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/FileSystemResourceManager.java | Returns ResourceAttributes for broken symlinks (instead of null). |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFile.java | Makes read APIs return empty content for dangling symlinks rather than erroring as “file not found”. |
| resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/linux/LinuxFileNatives.java | Preserves symlink-node metadata for dangling links (while keeping “target missing” exists=false semantics). |
| resources/bundles/org.eclipse.core.filesystem/natives/unix/fastlinux/fastlinuxfile.c | Retains lstat data for dangling links when following the link fails during directory listing/stat conversion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fc29ebb to
d4c4f3a
Compare
Broken file links were not present in resource model before, now they are (at least with Linux x86_64 LinuxFileHandler or Java NIO PosixHandler, in the future hopefully on all Unix platforms). For "broken" link overlays we need an additional patch in Platform UI. Fixes eclipse-platform#2797
d4c4f3a to
9e1b8b8
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
For link overlays we need an additional patch in Platform UI (eclipse-platform/eclipse.platform.ui#4158).
Fixes #2797